package demo3;

interface Ishape{
    void draw();
}
class Rect implements Ishape{

    @Override
    public void draw() {
        System.out.println("矩形！");
    }
}
class Flower implements Ishape{
    @Override
    public void draw() {
        System.out.println("✿！");
    }
}

public class Test2 {

    public static void shapeMap(Ishape ishape){
        ishape.draw();  //实现多态
    }
    public static void main(String[] args) {
        shapeMap(new Rect());
        shapeMap(new Flower());
    }
}
